package com.owen.shared.events;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.owen.liferay.shared.ClassProxy;

public class EditClassEvent extends GwtEvent<EditClassEvent.Handler> {

	public static final Type<Handler> TYPE = new Type<Handler>();
	private final ClassProxy clazz;

	public EditClassEvent(ClassProxy clazz) {
		super();
		this.clazz = clazz;
	}

	public interface Handler extends EventHandler {
		void processEdit(ClassProxy clazz);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.processEdit(clazz);
	}

}
